[XEND] Prevent invalid arguments for destroy event channels.
authorAlastair Tse <atse@xensource.com>
Wed, 24 Jan 2007 13:54:37 +0000 (13:54 +0000)
committerAlastair Tse <atse@xensource.com>
Wed, 24 Jan 2007 13:54:37 +0000 (13:54 +0000)
Signed-off-by: Alastair Tse <atse@xensource.com>
tools/python/xen/xend/XendDomainInfo.py

index 0a5f039a0d9c4a0e34dd9a5704e85a81a1332ed3..6696da4ab2ff2a5636ceea6b4edd33ee0175c194 100644 (file)
@@ -1577,18 +1577,21 @@ class XendDomainInfo:
         """Create an event channel to the domain.
         """
         try:
-            return xc.evtchn_alloc_unbound(domid=self.domid, remote_dom=0)
+            if self.domid != None:
+                return xc.evtchn_alloc_unbound(domid = self.domid,
+                                               remote_dom = 0)
         except:
-            log.exception("Exception in alloc_unbound(%d)", self.domid)
+            log.exception("Exception in alloc_unbound(%s)", str(self.domid))
             raise
 
     def _resetChannels(self):
         """Reset all event channels in the domain.
         """
         try:
-            return xc.evtchn_reset(dom=self.domid)
+            if self.domid != None:
+                return xc.evtchn_reset(dom = self.domid)
         except:
-            log.exception("Exception in evtcnh_reset(%d)", self.domid)
+            log.exception("Exception in evtcnh_reset(%s)", str(self.domid))
             raise